﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ImportSettings.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines the ImportSettings type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.SharePoint.Wss.ContentMigration
{
    using System.Xml.Serialization;

    using Attributes;

    [CollaborisClass(
     Title = "Import Settings.",
     ReleaseStatus = ReleaseStatus.Stable,
     DisableDocumentation = false,
     ContactAuthorEmail = "Support@Collaboris.co.uk",
     Summary = "Defines the settings to import from a Content Migration Package (CMP).",
     ClassGuid = "{156E17A5-A7BA-4e1f-8A48-1BC321A7C668}"
    )]    
    public class ImportSettings
    {
        #region Fields (8) 

        private string baseFileName;
        private bool fileCompression;
        private string fileLocation;
        private bool ignoreWebParts;
        private bool includeSecurity;
      
        private string logFilePath;
        private bool retainObjectIdentity;

        #endregion Fields 

        #region Properties (8) 

        private bool makeInternalLinksRelative;
         
        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Converts absolute links to relative links.",
             Title = "Make Internal Links Relative.",
             Example = "true",
             InputHint = InputHint.Boolean)]
        public bool MakeInternalLinksRelative
        {
            get
            {
                return this.makeInternalLinksRelative;
            }
            set
            {
                this.makeInternalLinksRelative = value;
            }

        }

        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Specifies the file name of the CMP file. (Usually *.cab).",
             Title = "Base File Name.",
             Example = "exported_content.cmp",
             InputHint = InputHint.SingleText)]
        public string BaseFileName
        {
            get
            {
                return this.baseFileName;
            }
            set
            {
                this.baseFileName = value;
            }
        }

        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Specifies whether to use compression on the CMP file.",
             Title = "File Compression.",
             Example = "true",
             InputHint = InputHint.Boolean)]
        public bool FileCompression
        {
            get
            {
                return this.fileCompression;
            }
            set
            {
                this.fileCompression = value;
            }
        }

        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Specifies the file location to containing the CMP.",
             Title = "File Location.",
             Example = @"${CurrentDirectory}",
             InputHint = InputHint.SingleText)]
        public string FileLocation
        {
            get
            {
                return this.fileLocation;
            }
            set
            {
                this.fileLocation = value;
            }
        }

        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Specifies whether to include web parts in the import.",
             Title = "Ignore Web Parts.",
             Example = @"true",
             InputHint = InputHint.Boolean)]
        public bool IgnoreWebParts
        {
            get
            {
                return this.ignoreWebParts;
            }
            set
            {
                this.ignoreWebParts = value;
            }
        }

        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Specifies whether to include users and permissions on the imported object.",
             Title = "Include Security.",
             Example = @"true",
             InputHint = InputHint.Boolean)]
        public bool IncludeSecurity
        {
            get
            {
                return this.includeSecurity;
            }
            set
            {
                this.includeSecurity = value;
            }
        }


        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Specifies the location to store the generated log to.",
             Title = "Log File Path.",
             Example = @"${TEMP}\Migration\ImportLog.txt",
             InputHint = InputHint.SingleText)]
        public string LogFilePath
        {
            get
            {
                return this.logFilePath;
            }
            set
            {
                this.logFilePath = value;
            }
        }

        [XmlAttribute]
        [CollaborisProperty(
             Summary = "Specifies whether to retain GUIDs during the import.",
             Title = "Retain Object Identity.",
             Example = @"false",
             InputHint = InputHint.Boolean)]
        public bool RetainObjectIdentity
        {
            get
            {
                return this.retainObjectIdentity;
            }
            set
            {
                this.retainObjectIdentity = value;
            }
        }

        #endregion Properties 
    }
}